package com.admin4j.server.system.controller;

import com.admin4j.common.util.UserContextUtil;
import com.admin4j.framework.web.pojo.R;
import com.admin4j.server.system.entity.vo.SysUserLoginInfoVO;
import com.admin4j.server.system.manager.IUserProfileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户信息表 前端控制器
 * </p>
 *
 * @author andanyang
 * @since 2023-11-07
 */
@RestController
@RequestMapping("/user")
public class SysUserController {

    @Autowired
    IUserProfileService sysUserLongInfoService;

    @GetMapping()
    public R<SysUserLoginInfoVO> getUserInfo() {
        SysUserLoginInfoVO sysUserLoginInfoVO = sysUserLongInfoService.getUserInfoByUserId(UserContextUtil.getUserId());
        return R.ok(sysUserLoginInfoVO);
    }
}
